package com.example.demo.mapper;

import com.example.demo.domain.entity.TrainClass;
import com.example.demo.domain.entity.TrainClassUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.domain.model.ClassUserCount;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author liguang
* @description 针对表【train_class_user(培训系统-班级-用户关系)】的数据库操作Mapper
* @createDate 2023-11-23 21:10:29
* @Entity com.example.demo.domain.entity.TrainClassUser
*/
public interface TrainClassUserMapper extends BaseMapper<TrainClassUser> {

    void getSubmitDetail(Long trainClassId, Long homeworkId, int offset, int pageSize);

    List<TrainClass> getUserClasses(@Param("userId") Long userId, @Param("offset") int offset, @Param("limit") int pageSize1);

    Long countUserClasses(@Param("userId") Long userId);

    List<ClassUserCount> countUserByClassIds(@Param("classIds") List<Long> collect);

    /**
     * 根据真实姓名查询班级数量
     * @param realName
     * @return
     */
    Long countUserClassesByRealName(@Param("realName")String realName);

    /**
     * 根据真实姓名查询班级
     * @param realName
     * @param offset
     * @param pageSize1
     * @return
     */
    List<TrainClass> getUserClassesByRealName(@Param("realName")String realName, @Param("offset") int offset,@Param("limit") int pageSize1);
}




